package cn.hsa.fqz.util;

import cn.hsa.fqz.task.enums.UserCategoryEnums;

/**
 * @Description TODO
 * @ClassName UserRegionUtils
 * @Author Liu.Jun
 * @Create 2023-06-12 17:02
 * @Version 1.0.0
 */
public class UserRegionUtils {

    public final static String GLOBAL_USER_ASCM = "100000";

    public static UserCategoryEnums getUserCateEnumByAscm(String ascm){
        if(ascm.equals(GLOBAL_USER_ASCM)){
            return  UserCategoryEnums.GLOBAL;
        }else if(ascm.endsWith("0000")||ascm.substring(2,4).endsWith("99")){
            return  UserCategoryEnums.PROVINCE;
        }else if(ascm.endsWith("00")||ascm.endsWith("99")){
            return  UserCategoryEnums.CITY;
        }else{
            return UserCategoryEnums.CITY;
        }
        //return UserCategoryEnums.GLOBAL;
    }
}
